home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_lib.arc / PCFREE.C < prev    next >
Text File  |  1990-08-09  |  979b  |  37 lines

  1. /**
  2. *
  3. *  Name         pcfree -- Release an allocated memory block
  4. *
  5. *  Synopsis     ercode = pcfree(seg);
  6. *               int ercode        Returned error code
  7. *               unsigned seg      Segment address of memory block
  8. *
  9. *  Description  This function frees memory blocks which have been
  10. *               allocated by the PCALLOC function.  The segment address
  11. *               of the memory block to be released must be associated
  12. *               with a previously allocated block.
  13. *
  14. *  Returns      ercode            DOS 2.0 function return code
  15. *
  16. *  Version      1.1  (C)Copyright Blaise Computing Inc.  1983, 1984
  17. *
  18. **/
  19. struct dreg
  20. {
  21.   unsigned ax,bx,cx,dx,si,di,ds,es;
  22. };
  23.  
  24. int pcfree(seg)
  25. unsigned seg;
  26. {
  27.  
  28.     struct dreg dos_reg;
  29.  
  30.     utinit(&dos_reg);                  /* Initialize the registers     */
  31.     dos_reg.ax = 0x4900;               /* DOS function 49h             */
  32.     dos_reg.es = seg;
  33.  
  34.     return(dos(&dos_reg));
  35.  
  36. }
  37.